package com.xiaoma.tpo.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.xiaoma.tpo.baseDao.BaseDaoImpl;
import com.xiaoma.tpo.domain.ClsListening;

@Repository
public class ClsListeningDao extends BaseDaoImpl<ClsListening> {

    public ClsListening findByCourseId(int courseId) {
        ClsListening entity = new ClsListening();
        entity.setClsCourseId(courseId);
        List<ClsListening> listenings = this.findByColumns(entity);
        return listenings.size() > 0 ? listenings.get(0) : null;
    }
    
}
